/*
 * AgentIdManager.h
 *
 */

#ifndef AGENTIDMANAGER_H_
#define AGENTIDMANAGER_H_

#include <iostream>
#include "../IPC/Semaphore.h"

namespace channel {

class AgentIdManager {
public:
	AgentIdManager(std::string hostName);
	virtual ~AgentIdManager();

	static void create(std::string hostName);

	static void destroy(std::string hostName);

	void registerAgent(std::string agentName, int &mtype);

	void unregisterAgent(std::string agentName);

	int getAgentId(std::string agentName);

	static const std::string AGENT_RESOLVE_BASE_PATH;

private:
	std::string m_hostName;
	std::string m_FilePath;
	ipc::Semaphore m_Sem;
};

} /* namespace channel */
#endif /* AGENTIDMANAGER_H_ */
